/**
  ******************************************************************************
  * @file   
  * @author 	
  * @version	
  * @date
  * @brief
  * @attention
  ******************************************************************************
  * @history
  * Ver	Date	Modified By	Why & What is modified
  *
  *
  *
  *
  * <h2><center>&copy; COPYRIGHT 2014 INMOTION TECHNOLOGIES CO.,LTD.</center></h2>
  ******************************************************************************
  */
#ifndef SYSRT_QUEUE_H
#define SYSRT_QUEUE_H
  
#ifdef __cplusplus
extern "C" {
#endif
	
#include <stm32f10x.h>
#include "RTC.h"
#include "my_type.h"
	
/** @addtogroup 
  * @{
  */

/** @addtogroup SysRTQueue_Exported_types
  * @{
  */
#pragma pack(1)	//byte aligned
typedef struct{
	rtc_time ctl_time;
	s16 drv_vq;
	s16 drv_vd;
	s16 drv_iq;
	s16 drv_lineCurrent;
	s16 drv_speed;
	u16 drv_batVolt;
	u8 drv_batSignal;
	u8 drv_mosTemp;
	s16 ctl_pitchAngle;
	s16 ctl_rollAngle;
	s16 ctl_xGyro;
	u64 ctl_mileage;
}SysRealTimeInfo;
#pragma pack()

typedef struct
{
	u16 h;
	u16 t;
	SysRealTimeInfo *pBuf;
	u16 maxsize;
}SysRTQueue;
/**
  * @}
  */

/** @defgroup SysRTQueue_Exported_Variables
  * @{
  */

/**
  * @}
  */

/** @addtogroup SysRTQueue_Exported_Constants
  * @{
  */

/**
  * @}
  */

/** @addtogroup SysRTQueue_Exported_Macros
  * @{
  */

/**
  * @}
  */

/** @addtogroup SysRTQueue_Exported_Functions
  * @{
  */
extern void InitSysRTQ(SysRTQueue *queue, SysRealTimeInfo *buf, u16 bufcnt);
extern u16 SysRTQPush(SysRTQueue *queue, SysRealTimeInfo element);
extern SysRealTimeInfo SysRTQPop(SysRTQueue *queue);
extern u16 SysRTQFull(SysRTQueue *queue);
/**
  * @}
  */
  
#ifdef __cplusplus
}
#endif

#endif	/* SYSRT_QUEUE_H */
  
/**
  * @}
  */

/********* (C) COPYRIGHT 2014 INMOTION TECHNOLOGIES CO.,LTD. ***END OF FILE***/
